package org.fly.utils;

import org.fly.bean.BaseUser;
import org.fly.bean.User;

/**
 * @author fly
 */

public class UserContext {

    private static ThreadLocal<BaseUser> userThreadLocal = new ThreadLocal<BaseUser>();


    public static BaseUser getUser() {
        return userThreadLocal.get();
    }


    public static void setUser(BaseUser user) {
        userThreadLocal.set(user);
    }

    public static void release() {
        userThreadLocal.remove();
    }
}
